ODPP coat of arms
Build reference · Django

Seed Data & System Map

Everything below is written as runnable code in django/ — five apps, a management command, and a coherent SD → CRB → ODPP → complaint chain to develop against.
Run order
python manage.py makemigrations core cases complaints insight
python manage.py migrate
python manage.py migrate --database=conduct conduct # Type A lives in its own DB
python manage.py seed_odpp
python manage.py createsuperuser
coreMain app. StaffUser, Region, Station, Statute, PenalCodeOffence, auth views, role mixins, seeder.
casesCaseReference spine + FileMovement and PerusalMinute stubs for the later paper mirror.
complaintsIntake, Type B, event log, attachments, correspondence, public lodge + track.
conductType A only. Own database, own DB role, default-deny manager, AccessLog, self-recusal.
insightLatencySnapshot, PublicAggregate, nightly recompute, executive dashboard.
URL map — every route in the system
Path
View
Who
Does
{{ r.path }}
{{ r.view }}
{{ r.who }}
{{ r.does }}
Seed 1 — offence register, 35 offences across 6 statutes
Every row is written with verified=False and an odpp_department routing hint, so section numbers can be audited in the admin before this touches a real file. Numbering follows the Cap 120 usage in your process brief.
Section
Offence
Statute
Triable by
Max penalty
ODPP department
s.{{ o.section }}
{{ o.title }}
{{ o.statute }}
{{ o.triable }}
{{ o.penalty }}
{{ o.dept }}
Seed 2 — 12 Station Diary entries, 9 escalating to a CRB
Three entries deliberately stay at SD level — a lost ID card, a counselled domestic dispute, a civil debt. A real desk generates far more non-cognizable entries than cases, and the triage UI has to look right when most rows go nowhere.
{{ s.ref }}
{{ s.when }}
{{ s.complainant }}
{{ s.station }}
{{ s.narrative }}
{{ s.outcome }}
{{ s.crb }}
{{ s.offence }}
Seed 3 — the CRB chain, reconciled end to end
Five stages are represented on purpose — one in transit and never received (that is the lost-file complaint), one on DFI, one sanctioned and in court, one closed, and two under perusal. The dashboard needs all five to look honest.
CRB
ODPP file
Court
Accused / offence
Dwell
Stage
{{ c.crb }}
{{ c.odpp }}
{{ c.court }}
{{ c.accused }}
{{ c.dwell }}
{{ c.stage }}
Seed 4 — five complaints that reach the ODPP
Two Type A and three Type B, each at a different point in the lifecycle so every screen has something real to render: one mid-inquiry, one determined, one determined and communicated, one closed, one freshly assigned. Each carries a full event log with authored timestamps.
{{ c.reference }} {{ c.typeLabel }}
Complainant{{ c.name }}{{ c.district }}
Channel{{ c.channel }}
Linked case{{ c.case }}
Assigned{{ c.assigned }}
{{ c.band }} {{ c.age }}
{{ c.narrativeLabel }}
{{ c.narrative }}
Event log
{{ e.when }} {{ e.state }} {{ e.note }}
Finding · {{ c.finding }} {{ c.remedy }}
Seed 5 — nine staff logins
One per role plus two clerks, so you can log in as each and confirm the queryset scoping actually bites. Development password for all nine: odpp-dev-2026 — change the constant before any shared deployment.
Username
Name
Title
Region
Lands on
{{ u.username }}
{{ u.name }}
{{ u.title }}
{{ u.region }}
{{ u.lands }}
Three things to check before you build on this
Section numbers
The seed uses the numbering in your brief. Confirm each against the current revised edition of the Penal Code Act and flip verified in the admin as you go — the field exists so this audit leaves a trace.
Real names in seed data
Staff rows use real ODPP officials from the public site, and complainants are invented. Before any shared environment, swap the staff names for placeholders — a demo database that looks like a real personnel record is a liability.
Second database
The conduct app only isolates if the conduct alias uses a different Postgres role with no grants on the main schema. Same credentials in both aliases means the router is decoration.
Companion to the ODPP Brand & Process Reference and the Record System Blueprint. HTML templates for these views come next. Seed v1 · 26 August 2026
Built by Nova Generation
Powered by Sprint UG — Live Unlimited